package com.ckx.config.circuitbreaker;

import org.springframework.cloud.circuitbreaker.resilience4j.Resilience4JCircuitBreakerFactory;
import org.springframework.cloud.client.circuitbreaker.Customizer;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executors;

@Component
public class MyCustomizer implements Customizer<Resilience4JCircuitBreakerFactory> {
    @Override
    public void customize(Resilience4JCircuitBreakerFactory resilience4JCircuitBreakerFactory) {
        resilience4JCircuitBreakerFactory.configureExecutorService(Executors.newVirtualThreadPerTaskExecutor());
    }
}
